home *** CD-ROM | disk | FTP | other *** search
- #include <iostream.h>
- #include <stdlib.h>
- #include "./cgi.h"
-
- cgi_main(cgi_info *ci)
- {
- int ad,bd,rd,c;
- form_entry *params = NULL;
- params = get_form_entries(ci);
-
- print_mimeheader("text/html");
- if (params != NULL)
- { ad = atoi(parmval(params,"a"));
- bd = atoi(parmval(params,"b"));
- rd = atoi(parmval(params,"round"));
- c = ((ad * bd)/rd) * rd;
- cout << "<html>" << parmval(params,"a") <<
- " times " << parmval(params,"b") << " = " << c <<
- "</html>";
- return 1;}
- else { cout << "<html> Please type in the two numbers which " <<
- "you want to multiply.<p>" <<
- "<form method=""post"" action=""/cgi-bin/nik/multiply"">" <<
- "<input name=""a""><p><input name=""b""><p>" <<
- "Round down to <SELECT name=""round""><OPTION SELECTED> 1" <<
- "<OPTION> 10 <OPTION> 100 </SELECT><p>" <<
- "<input type=""submit""></form></html>";
- return 1;}
- }
-
-